DevForce Help Reference
GroupBy<TSource,TKey,TElement>(IEntityQuery<TSource>,Expression<Func<TSource,TKey>>,Expression<Func<TSource,TElement>>) Method
Example 


Groups the elements of a sequence according to a specified key selector function and projects the elements for each group by using a specified function.
Syntax

Parameters

source
keySelector
elementSelector

Type Parameters

TSource
TKey
TElement
Example
var mgr = new DomainModelEntityManager();

var query = mgr.Customers.GroupBy(c => c.Country, c=> c.CompanyName);
foreach (var group in query) {
  Console.WriteLine("key = " + group.Key);
  foreach (var cust in group) {
    Console.WriteLine("Cust = " + cust);
  }
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

EntityQueryExtensions Class
EntityQueryExtensions Members
Overload List

Send Feedback